<template>


  <div class="app-container">
    <el-card class="box-card">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"  >
      <el-form-item label="时间" prop="phoneTime">
        <el-date-picker clearable
                        v-model="queryParams.phoneTime"
                        format="yyyy-MM-dd HH:mm"
                        type="datetime"
                        value-format="yyyy-MM-dd HH:mm"
                        placeholder="请输入时间">
        </el-date-picker>
      </el-form-item>

      <el-form-item label="姓名" prop="speakerName">
        <el-input
          v-model="queryParams.speakerName"
          placeholder="请输入来话人姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
<!--      <el-form-item label="时间" prop="phoneTime">
        <el-input
          v-model="queryParams.phoneTime"
          placeholder="请输入时间"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
<!--      <el-form-item label="来话人" prop="speakerDepartment">
        <el-input
          v-model="queryParams.speakerDepartment"
          placeholder="请输入来话人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="来话人" prop="speakerPosition">
        <el-input
          v-model="queryParams.speakerPosition"
          placeholder="请输入来话人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="来话人" prop="speakerName">
        <el-input
          v-model="queryParams.speakerName"
          placeholder="请输入来话人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="来话人" prop="speakerIdNumber">
        <el-input
          v-model="queryParams.speakerIdNumber"
          placeholder="请输入来话人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="受话人" prop="addresseeDepartment">
        <el-input
          v-model="queryParams.addresseeDepartment"
          placeholder="请输入受话人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="受话人" prop="addresseePosition">
        <el-input
          v-model="queryParams.addresseePosition"
          placeholder="请输入受话人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="受话人" prop="addresseeName">
        <el-input
          v-model="queryParams.addresseeName"
          placeholder="请输入受话人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="受话人" prop="addresseeIdNumber">
        <el-input
          v-model="queryParams.addresseeIdNumber"
          placeholder="请输入受话人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注" prop="phoneNote">
        <el-input
          v-model="queryParams.phoneNote"
          placeholder="请输入备注"
          clearable
          @keyup.enter.native="handleQuery"
        />-->
<!--      </el-form-item>
      <el-form-item label="领导批示" prop="superiorOpinion">
        <el-input
          v-model="queryParams.superiorOpinion"
          placeholder="请输入领导批示"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
<!--      <el-form-item label="落实情况" prop="carryOutSituation">
        <el-input
          v-model="queryParams.carryOutSituation"
          placeholder="请输入落实情况"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
<!--      <el-form-item label="批示范围" prop="instructionsScope">
        <el-input
          v-model="queryParams.instructionsScope"
          placeholder="请输入批示范围"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="阅知范围" prop="readingKnowledgeScope">
        <el-input
          v-model="queryParams.readingKnowledgeScope"
          placeholder="请输入阅知范围"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="承办人" prop="undertaker" v-show="showSearch">
        <el-input
          v-model="queryParams.undertaker"
          placeholder="请输入承办人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
<!--      <el-form-item label="创建者" prop="createBy" v-show="showSearch">
        <el-input
          v-model="queryParams.createBy"
          placeholder="请输入创建者"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
<!--      <el-form-item label="创建时间" prop="createTime">
        <el-date-picker clearable
          v-model="queryParams.createTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择创建时间">
        </el-date-picker>
      </el-form-item>-->
<!--      <el-form-item label="更新者" prop="updateBy" v-show="showSearch">
        <el-input
          v-model="queryParams.updateBy"
          placeholder="请输入更新者"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
<!--      <el-form-item label="更新时间" prop="updateTime">
        <el-date-picker clearable
          v-model="queryParams.updateTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择更新时间">
        </el-date-picker>
      </el-form-item>-->
      <br/>
      <div style="text-align: right;">

        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>

      </div>
      <br/>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['dfx:phonerecord:add']"
        >新增</el-button>
      </el-col>
<!--      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['moudle:dfx:phonerecord:edit']"
        >修改</el-button>
      </el-col>-->
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['dfx:phonerecord:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:phonerecord:export']"
        >导出</el-button>
      </el-col>
<!--      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="phonerecordList"  border @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
<!--      <el-table-column label="ID" align="center" prop="id" />-->
<!--      <el-table-column label="编号" align="center" prop="serialNumber" />-->
      <el-table-column label="时间" align="center" prop="phoneTime" />
<!--      <el-table-column label="来话人单位" align="center" prop="speakerDepartment" />-->
      <!-- <el-table-column label="来话人" align="center" prop="speakerPosition" />

       <el-table-column label="来话人" align="center" prop="speakerIdNumber" />
       <el-table-column label="受话人" align="center" prop="addresseeDepartment" />
       <el-table-column label="受话人" align="center" prop="addresseePosition" />-->
       <el-table-column label="来话人姓名" align="center" prop="speakerName" />
       <el-table-column label="受话人姓名" align="center" prop="addresseeName" />
<!--       <el-table-column label="受话人" align="center" prop="addresseeIdNumber" />-->
<!--      <el-table-column label="内容" align="center" prop="phoneContent" />
      <el-table-column label="备注" align="center" prop="phoneNote" />
      <el-table-column label="领导批示" align="center" prop="superiorOpinion" />
      <el-table-column label="落实情况" align="center" prop="carryOutSituation" />-->
<!--      <el-table-column label="批示范围" align="center" prop="instructionsScope" />
      <el-table-column label="阅知范围" align="center" prop="readingKnowledgeScope" />
      <el-table-column label="承办人" align="center" prop="undertaker" />
      <el-table-column label="创建者" align="center" prop="createBy" />
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="更新者" align="center" prop="updateBy" />
      <el-table-column label="更新时间" align="center" prop="updateTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="备注1" align="center" prop="note1" />
      <el-table-column label="备注2" align="center" prop="note2" />
      <el-table-column label="备注3" align="center" prop="note3" />
      <el-table-column label="备注4" align="center" prop="note4" />
      <el-table-column label="备注5" align="center" prop="note5" />
      <el-table-column label="备注6" align="center" prop="note6" />
      <el-table-column label="备注7" align="center" prop="note7" />
      <el-table-column label="备注8" align="center" prop="note8" />
      <el-table-column label="备注9" align="center" prop="note9" />
      <el-table-column label="备注10" align="center" prop="note10" />-->
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope" >
          <el-button
            size="mini"
            type="text"

            @click="handleUpdate(scope.row)"
            v-hasPermi="['dfx:phonerecord:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"

            @click="handleDelete(scope.row)"
            v-hasPermi="['dfx:phonerecord:remove']"
          >删除</el-button>
          <el-button
            size="mini"
            type="text"

            @click="handleView(scope.row,scope.index)"
            v-hasPermi="['dfx:phonerecord:query']"
          >详细</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    </el-card>
    <!-- 添加或修改电话记录对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
        <el-container>
        <el-header>
          <el-divider content-position="left">
            <p style="color: #00afff; font-size: 20px;">基本信息
            </p>
          </el-divider>
        </el-header>
        <el-main>

        <el-row>
          <el-col :span="8">
            <el-form-item label="姓名" prop="speakerName">
              <el-input v-model="form.speakerName" placeholder="请输入来话人姓名" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
       <el-form-item label="单位" prop="speakerDepartment">
          <el-input v-model="form.speakerDepartment" placeholder="请输入来话人单位" />
        </el-form-item>
<!--            <el-form-item label="单位（来话人）" prop="speakerDepartment">
              <treeselect v-model="form.speakerDepartment" :options="deptOptions" :show-count="true" placeholder="请选择单位" />
            </el-form-item>-->
          </el-col>
          <el-col :span="8">
        <el-form-item label="职务" prop="speakerPosition">
          <el-input v-model="form.speakerPosition" placeholder="请输入来话人职务" />
        </el-form-item>
          </el-col>
        </el-row>
<!--          <el-form-item label="内容">
            <editor v-model="form.phoneContent" :min-height="192"/>
          </el-form-item>-->
          <el-form-item label="内容" prop="causes">
            <el-input v-model="form.phoneContent" type="textarea" :rows="6" placeholder="请输入内容"/>
            <!-- <editor v-model="form.causes" :min-height="192" placeholder="请输入事由" />-->
          </el-form-item>
<!--        <el-row>
          <el-col :span="12">
        <el-form-item label="姓名（来话人）" prop="speakerName">
          <el-input v-model="form.speakerName" placeholder="请输入姓名" />
        </el-form-item>
          </el-col>
          <el-col :span="12">
&lt;!&ndash;        <el-form-item label="身份证号（来话人）" prop="speakerIdNumber">
          <el-input v-model="form.speakerIdNumber" placeholder="请输入身份证号" />
        </el-form-item>&ndash;&gt;
          </el-col>
        </el-row>-->
<!--        <el-row>
          <el-col :span="12">
        <el-form-item label="单位（受话人）" prop="addresseeDepartment">
&lt;!&ndash;          <el-input v-model="form.addresseeDepartment" placeholder="请输入单位" />&ndash;&gt;
          <treeselect v-model="form.addresseeDepartment" :options="deptOptions" :show-count="true" placeholder="请选择单位" />
        </el-form-item>
          </el-col>
          <el-col :span="12">
        <el-form-item label="职务（受话人）" prop="addresseePosition">
          <el-input v-model="form.addresseePosition" placeholder="请输入职务" />
        </el-form-item>
          </el-col>
        </el-row>-->
<!--        <el-row>
          <el-col :span="12">
        <el-form-item label="姓名（受话人）" prop="addresseeName">
          <el-input v-model="form.addresseeName" type="addresseeName" placeholder="请输入姓名" />
        </el-form-item>
          </el-col>
          <el-col :span="12">
        <el-form-item label="身份证号（受话人）" prop="addresseeIdNumber">
          <el-input v-model="form.addresseeIdNumber" placeholder="请输入身份证号" />
        </el-form-item>
          </el-col>
        </el-row>-->
          <el-row>
            <el-col :span="8">
              <!--              <el-form-item label="备注" prop="phoneNote">
                              <el-input v-model="form.phoneNote" placeholder="请输入备注" />
                            </el-form-item>-->
              <!--        <el-form-item label="时间" prop="phoneTime">
                        <el-input v-model="form.phoneTime" placeholder="请输入时间" />
                      </el-form-item>-->
              <el-form-item label="时间" prop="phoneTime">
                <el-date-picker clearable
                                v-model="form.phoneTime"
                                format="yyyy-MM-dd HH:mm"
                                type="datetime"
                                style="width:100%;"
                                value-format="yyyy-MM-dd HH:mm"
                                placeholder="请输入时间">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="代填" prop="isSubstitute">
                <el-radio-group v-model="form.isSubstitute">
                  <el-radio label="1">否</el-radio>
                  <el-radio label="2">是</el-radio>
                </el-radio-group>
              </el-form-item>
              <!--        <el-form-item label="编号" prop="serialNumber">
                        <el-input v-model="form.serialNumber" placeholder="请输入编号" />
                      </el-form-item>-->

            </el-col>

            <el-col :span="8">
              <el-form-item label="备注" prop="phoneNote">
                <el-input v-model="form.phoneNote" placeholder="请输入备注" />
              </el-form-item>
            </el-col>
          </el-row>


<!--          <el-form-item label="是否代填">
            <el-radio-group v-model="form.isSubstitute">
              <el-radio
                v-for="dict in dict.type.yh_is_substitute"
                :key="dict.value"
                :label="dict.value"
              >{{dict.label}}</el-radio>
            </el-radio-group>
          </el-form-item>-->



          <el-header>
            <el-col :span="24" v-if="form.isSubstitute == '2'" >
            <el-divider content-position="left">
              <p style="color: #00afff; font-size: 20px;">代填信息
              </p>
            </el-divider>
            </el-col>
          </el-header>

          <el-row>
            <el-col :span="8" v-if="form.isSubstitute == '2'" >
              <el-form-item prop="substituteName" label="姓名">
                <el-input v-model="form.substituteName" placeholder="请输入代填人（姓名）" />
              </el-form-item>
            </el-col>
          <el-col :span="8" v-if="form.isSubstitute == '2'">
            <el-form-item prop="substituteDepartment" label="单位">
              <el-input v-model="form.substituteDepartment" placeholder="请输入代填人（单位）" />
            </el-form-item>
          </el-col>
            <el-col :span="8" v-if="form.isSubstitute == '2'">
              <el-form-item prop="substitutePosition" label="职务">
                <el-input v-model="form.substitutePosition" placeholder="请输入代填人（职务）" />
              </el-form-item>
            </el-col>
          </el-row>

<!--          <el-row>
          <el-col :span="12" v-if="form.isSubstitute == '2'">
            <el-form-item prop="substitutePosition" label="职务">
              <el-input v-model="form.substitutePosition" placeholder="请输入代填人（职务）" />
            </el-form-item>
          </el-col>
&lt;!&ndash;            <el-col :span="12" v-if="form.isSubstitute == '2'">
              <el-form-item prop="substituteIdNumber" label="身份证号">
                <el-input v-model="form.substituteIdNumber" placeholder="请输入代填人（身份证号）" />
              </el-form-item>
            </el-col>&ndash;&gt;
          </el-row>-->
<!--        <el-form-item label="领导批示" prop="superiorOpinion">
          <el-input v-model="form.superiorOpinion" placeholder="请输入领导批示" />
        </el-form-item>
        <el-form-item label="落实情况" prop="carryOutSituation">
          <el-input v-model="form.carryOutSituation" placeholder="请输入落实情况" />
        </el-form-item>
        <el-form-item label="批示范围" prop="instructionsScope">
          <el-input v-model="form.instructionsScope" placeholder="请输入批示范围" />
        </el-form-item>
        <el-form-item label="阅知范围" prop="readingKnowledgeScope">
          <el-input v-model="form.readingKnowledgeScope" placeholder="请输入阅知范围" />
        </el-form-item>
        <el-form-item label="承办人" prop="undertaker">
          <el-input v-model="form.undertaker" placeholder="请输入承办人" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注1" prop="note1">
          <el-input v-model="form.note1" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注2" prop="note2">
          <el-input v-model="form.note2" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注3" prop="note3">
          <el-input v-model="form.note3" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注4" prop="note4">
          <el-input v-model="form.note4" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注5" prop="note5">
          <el-input v-model="form.note5" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注6" prop="note6">
          <el-input v-model="form.note6" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注7" prop="note7">
          <el-input v-model="form.note7" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注8" prop="note8">
          <el-input v-model="form.note8" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注9" prop="note9">
          <el-input v-model="form.note9" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注10" prop="note10">
          <el-input v-model="form.note10" type="textarea" placeholder="请输入内容" />
        </el-form-item>-->
        </el-main>
        </el-container>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

<!--&lt;!&ndash;详细信息&ndash;&gt;
    <el-dialog :title="view.title" :visible.sync="view.open" width="1000px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="140px">
&lt;!&ndash;        <el-container>

          <el-main>
            &lt;!&ndash;第一行&ndash;&gt;
            <el-row>
              <el-col :span="12">
                <el-form-item label="编号" prop="serialNumber">
                  <el-input v-model="form.serialNumber" placeholder="请输入编号" readonly="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                &lt;!&ndash;        <el-form-item label="时间" prop="phoneTime">
                          <el-input v-model="form.phoneTime" placeholder="请输入时间" />
                        </el-form-item>&ndash;&gt;
                <el-form-item label="时间" prop="phoneTime" >
                  <el-date-picker clearable
                                  v-model="form.phoneTime"
                                  format="yyyy-MM-dd HH:mm"
                                  style="width:100%;"
                                  type="datetime"
                                  readonly="true"
                                  value-format="yyyy-MM-dd HH:mm"
                                  placeholder="请输入时间">
                  </el-date-picker>
                </el-form-item>

                &lt;!&ndash;            <el-form-item label="时间" prop="phoneTime">

                                <a-date-picker
                                  style="min-width: 50%;"
                                  :show-time="{ format: 'HH:mm' }"
                                  format="YYYY-MM-DD HH:mm"
                                  v-model="form.phoneTime"
                                  @change="getInspectionTime"/>

                            </el-form-item>&ndash;&gt;

              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="单位（来话人）" prop="speakerDepartment">
                  <treeselect v-model="form.speakerDepartment" :options="deptOptions" :show-count="true" placeholder="请选择单位" readonly="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="职务（来话人）" prop="speakerPosition">
                  <el-input v-model="form.speakerPosition" placeholder="请输入职务" readonly="true"/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="姓名（来话人）" prop="speakerName">
                  <el-input v-model="form.speakerName" placeholder="请输入姓名" readonly="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="身份证号（来话人）" prop="speakerIdNumber">
                  <el-input v-model="form.speakerIdNumber" placeholder="请输入身份证号" readonly="true"/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="单位（受话人）" prop="addresseeDepartment">
                  <treeselect v-model="form.addresseeDepartment" :options="deptOptions" :show-count="true" placeholder="请选择单位" readonly="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="职务（受话人）" prop="addresseePosition">
                  <el-input v-model="form.addresseePosition" placeholder="请输入职务" readonly="true"/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="姓名（受话人）" prop="addresseeName">
                  <el-input v-model="form.addresseeName" type="addresseeName" placeholder="请输入姓名" readonly="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="身份证号（受话人）" prop="addresseeIdNumber">
                  <el-input v-model="form.addresseeIdNumber" placeholder="请输入身份证号" readonly="true"/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-form-item label="备注" prop="phoneNote">
              <el-input v-model="form.phoneNote" placeholder="请输入备注" readonly="true"/>
            </el-form-item>
            <el-form-item label="内容">
              <editor v-model="form.phoneContent" :min-height="192" readonly="true"/>
            </el-form-item>




          </el-main>
        </el-container>&ndash;&gt;
        <el-container>
          <el-header>
            <el-divider content-position="left">
              <p style="color: #00afff; font-size: 20px;">详细信息
              </p>
            </el-divider>
          </el-header>
          <el-main>

            <el-form-item label="编号" prop="serialNumber">
              <el-input v-model="form.serialNumber" placeholder="请输入编号" readonly="true" />
            </el-form-item>
&lt;!&ndash;            <el-header>
              <el-divider content-position="left">
                <p style="color: #00afff; font-size: 20px;">来话人信息
                </p>
              </el-divider>
            </el-header>&ndash;&gt;
            <el-row>
              <el-col :span="8">
                <el-form-item label="来话人姓名" prop="speakerName">
                  <el-input v-model="form.speakerName" placeholder="请输入来话人姓名" readonly="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="来话人单位" prop="speakerDepartment">
                  <el-input v-model="form.speakerDepartment" placeholder="请输入来话人单位" readonly="true"/>
                </el-form-item>
                &lt;!&ndash;            <el-form-item label="单位（来话人）" prop="speakerDepartment">
                              <treeselect v-model="form.speakerDepartment" :options="deptOptions" :show-count="true" placeholder="请选择单位" />
                            </el-form-item>&ndash;&gt;
              </el-col>
              <el-col :span="8">
                <el-form-item label="来话人职务" prop="speakerPosition">
                  <el-input v-model="form.speakerPosition" placeholder="请输入来话人职务" readonly="true"/>
                </el-form-item>
              </el-col>
            </el-row>



&lt;!&ndash;            <el-form-item label="内容">
              <editor v-model="form.phoneContent" :min-height="192" readonly="true"/>
            </el-form-item>&ndash;&gt;
            <el-form-item label="内容" prop="causes">
              <el-input v-model="form.phoneContent" type="textarea" :rows="6" placeholder="请输入内容"/>
              &lt;!&ndash; <editor v-model="form.causes" :min-height="192" placeholder="请输入事由" />&ndash;&gt;
            </el-form-item>
            &lt;!&ndash;        <el-row>
                      <el-col :span="12">
                    <el-form-item label="姓名（来话人）" prop="speakerName">
                      <el-input v-model="form.speakerName" placeholder="请输入姓名" />
                    </el-form-item>
                      </el-col>
                      <el-col :span="12">
            &lt;!&ndash;        <el-form-item label="身份证号（来话人）" prop="speakerIdNumber">
                      <el-input v-model="form.speakerIdNumber" placeholder="请输入身份证号" />
                    </el-form-item>&ndash;&gt;
                      </el-col>
                    </el-row>&ndash;&gt;
            &lt;!&ndash;        <el-row>
                      <el-col :span="12">
                    <el-form-item label="单位（受话人）" prop="addresseeDepartment">
            &lt;!&ndash;          <el-input v-model="form.addresseeDepartment" placeholder="请输入单位" />&ndash;&gt;
                      <treeselect v-model="form.addresseeDepartment" :options="deptOptions" :show-count="true" placeholder="请选择单位" />
                    </el-form-item>
                      </el-col>
                      <el-col :span="12">
                    <el-form-item label="职务（受话人）" prop="addresseePosition">
                      <el-input v-model="form.addresseePosition" placeholder="请输入职务" />
                    </el-form-item>
                      </el-col>
                    </el-row>&ndash;&gt;
            &lt;!&ndash;        <el-row>
                      <el-col :span="12">
                    <el-form-item label="姓名（受话人）" prop="addresseeName">
                      <el-input v-model="form.addresseeName" type="addresseeName" placeholder="请输入姓名" />
                    </el-form-item>
                      </el-col>
                      <el-col :span="12">
                    <el-form-item label="身份证号（受话人）" prop="addresseeIdNumber">
                      <el-input v-model="form.addresseeIdNumber" placeholder="请输入身份证号" />
                    </el-form-item>
                      </el-col>
                    </el-row>&ndash;&gt;
            <el-row>
              <el-col :span="8">
                &lt;!&ndash;              <el-form-item label="备注" prop="phoneNote">
                                <el-input v-model="form.phoneNote" placeholder="请输入备注" />
                              </el-form-item>&ndash;&gt;
                &lt;!&ndash;        <el-form-item label="时间" prop="phoneTime">
                          <el-input v-model="form.phoneTime" placeholder="请输入时间" />
                        </el-form-item>&ndash;&gt;
                <el-form-item label="时间" prop="phoneTime">
                  <el-date-picker clearable
                                  v-model="form.phoneTime"
                                  format="yyyy-MM-dd HH:mm"
                                  type="datetime"
                                  style="width:100%;"
                                  value-format="yyyy-MM-dd HH:mm"
                                  placeholder="请输入时间">
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="代填" prop="isSubstitute">
                  <el-radio-group v-model="form.isSubstitute" readonly="true">
                    <el-radio label="1">否</el-radio>
                    <el-radio label="2">是</el-radio>
                  </el-radio-group>
                </el-form-item>
                &lt;!&ndash;        <el-form-item label="编号" prop="serialNumber">
                          <el-input v-model="form.serialNumber" placeholder="请输入编号" />
                        </el-form-item>&ndash;&gt;

              </el-col>

              <el-col :span="8">
                <el-form-item label="备注" prop="phoneNote">
                  <el-input v-model="form.phoneNote" placeholder="请输入备注" readonly="true"/>
                </el-form-item>
              </el-col>
            </el-row>


            &lt;!&ndash;          <el-form-item label="是否代填">
                        <el-radio-group v-model="form.isSubstitute">
                          <el-radio
                            v-for="dict in dict.type.yh_is_substitute"
                            :key="dict.value"
                            :label="dict.value"
                          >{{dict.label}}</el-radio>
                        </el-radio-group>
                      </el-form-item>&ndash;&gt;



            <el-header>
              <el-col :span="24" v-if="form.isSubstitute == '2'" >
                <el-divider content-position="left">
                  <p style="color: #00afff; font-size: 20px;">代填信息
                  </p>
                </el-divider>
              </el-col>
            </el-header>

            <el-row>
              <el-col :span="8" v-if="form.isSubstitute == '2'" >
                <el-form-item prop="substituteName" label="姓名">
                  <el-input v-model="form.substituteName" placeholder="请输入代填人（姓名）" readonly="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="8" v-if="form.isSubstitute == '2'">
                <el-form-item prop="substituteDepartment" label="单位">
                  <el-input v-model="form.substituteDepartment" placeholder="请输入代填人（单位）" readonly="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="8" v-if="form.isSubstitute == '2'">
                <el-form-item prop="substitutePosition" label="职务">
                  <el-input v-model="form.substitutePosition" placeholder="请输入代填人（职务）" readonly="true"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-header>
              <el-col :span="24" v-if="form.isSubstitute == '1'" >
                <el-divider content-position="left">
                  <p style="color: #00afff; font-size: 20px;">受话人信息
                  </p>
                </el-divider>
              </el-col>
            </el-header>
            <el-row>
              <el-col :span="8" v-if="form.isSubstitute == '1'">
                <el-form-item label="姓名" prop="speakerName" >
                  <el-input v-model="form.addresseeName" placeholder="请输入姓名" readonly="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="8" v-if="form.isSubstitute == '1'">
                <el-form-item label="单位" prop="addresseeDepartment">
                  <treeselect v-model="form.addresseeDepartment" :options="deptOptions" :show-count="true" placeholder="请选择单位" readonly="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="8" v-if="form.isSubstitute == '1'">
                <el-form-item label="职务" prop="addresseePosition">
                  <el-input v-model="form.addresseePosition" placeholder="请输入职务" readonly="true"/>
                </el-form-item>
              </el-col>
            </el-row>


          </el-main>
        </el-container>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="viewCancel">取 消</el-button>
      </div>
    </el-dialog>-->

  </div>
</template>

<script>
import { listPhonerecord, getPhonerecord, delPhonerecord, addPhonerecord, updatePhonerecord } from "@/api/module/dfx/phonerecord";
import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";

export default {
  name: "Phonerecord",
  dicts: ['yh_is_substitute'],
  components: { Treeselect },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: false,
      // 总条数
      total: 0,
      // 电话记录表格数据
      phonerecordList: [],
      // 弹出层标题
      title: "",
      // 部门树选项
      deptOptions: undefined,
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        serialNumber: null,
        phoneTime: null,
        speakerDepartment: null,
        speakerPosition: null,
        speakerName: null,
        speakerIdNumber: null,
        addresseeDepartment: null,
        addresseePosition: null,
        addresseeName: null,
        addresseeIdNumber: null,
        phoneContent: null,
        phoneNote: null,
        superiorOpinion: null,
        carryOutSituation: null,
        instructionsScope: null,
        isSubstitute: null,
        substituteIdNumber:null,
        substitutePosition:null,
        substituteDepartment:null,
        substituteName:null,
        readingKnowledgeScope: null,
        undertaker: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      },
      // 用户查询参数
      view:{
        // 是否显示弹出层（用户查询）
        open: false,
        // 弹出层标题（用户查询）
        title: "",
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  watch: {
    // 根据名称筛选部门树
    deptName(val) {
      this.$refs.tree.filter(val);
    }
  },
  created() {
    this.getList();
    this.getTreeselect();
    this.getConfigKey("sys.user.initPassword").then(response => {
      this.initPassword = response.msg;
    });
  },
  methods: {
    /** 查询电话记录列表 */
    getList() {
      this.loading = true;
      listPhonerecord(this.queryParams).then(response => {
        this.phonerecordList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    /** 查询部门下拉树结构 */
    getTreeselect() {
      treeselect().then(response => {
        this.deptOptions = response.data;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 取消按钮
    viewCancel() {
      this.view.open = false;
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        serialNumber: null,
        phoneTime: null,
        speakerDepartment: null,
        speakerPosition: null,
        speakerName: null,
        speakerIdNumber: null,
        addresseeDepartment: null,
        addresseePosition: null,
        addresseeName: null,
        addresseeIdNumber: null,
        phoneContent: null,
        phoneNote: null,
        superiorOpinion: null,
        carryOutSituation: null,
        instructionsScope: null,
        readingKnowledgeScope: null,
        undertaker: null,
        createBy: null,
        createTime: null,
        isSubstitute: "1",
        substituteIdNumber:null,
        substitutePosition:null,
        substituteDepartment:null,
        substituteName:null,
        updateBy: null,
        updateTime: null,
        remark: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      };
      this.resetForm("form");
    },
    /** 详细按钮操作 */
    handleView(row) {
     /* const id = row.id || this.ids
      getPhonerecord(id).then(response => {
        this.form = response.data;
        this.view.open = true;
        this.view.title = "电话记录信息查看";
      });*/
      const id = row.id;
      this.$router.push({ path:"/zonghe/phonerecord_detail", query: {id}});
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加电话记录";

    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getPhonerecord(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改电话记录";
      });
    },

    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updatePhonerecord(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addPhonerecord(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除电话记录编号为"' + ids + '"的数据项？').then(function() {
        return delPhonerecord(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/phonerecord/export', {
        ...this.queryParams
      }, `phonerecord_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
